<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>广告管理</title>

<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="/Store/Public/layui/css/layui.css"></link>
<link rel="stylesheet" type="text/css" href="/Store/Public/Admin/dropzone/css/webuploader.css">
<link rel="stylesheet" type="text/css" href="/Store/Public/Admin/dropzone/css/style.css">
<script type="text/javascript" src="/Store/Public/Admin/js1/jquery-1.10.1.min.js"></script>
<script type="text/javascript" src="/Store/Public/layer/layer.js"></script>
<script type="text/javascript" src="/Store/Public/layui/layui.js"></script>
<style>
.demo{min-width:30px;margin:30px auto;padding:20px 20px}
.demo h3{line-height:40px; font-weight: bold;}
.file-item{float: left; position: relative; width: 110px;height: 110px; margin: 0 20px 20px 0; padding: 4px;}
.file-item .info{overflow: hidden;}
.uploader-list{width: 100%; overflow: hidden;}
</style>
</head>
<body>
<form action="/Store/index.php/Admin/Picture/dropzone" method="post" enctype="multipart/form-data">
        <div class="demo">
        <div id="dd" style="marign-right:-20px;"></div>
            <div id="uploader">
             
                    <div id="dndArea" class="placeholder" >
                        <div id="filePicker">
                         <p>将照片拖到这里</p>
                        </div>
                    </div>
                        <div>
                        <input type="file"  name="file" id="doc" multiple="multiple"  style="width:150px;" onchange="javascript:setImagePreviews();"/>
                        
                        </div>
                </div>
             </div>
       
            <textarea id="demo" name="title" style="display: none;"></textarea>
            &nbsp;
            <div class="row cl">
			   <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				     <input type="submit" value="确认" class="btn btn-success radius"  name="admin-role-save" style="margin-left:-205px"/>
	                 &nbsp;
                    <input type="reset" class="btn btn-success radius" value="取消">
	                     </div>
		       </div>
</form>
<script type="text/javascript">

//下面用于多图片上传预览功能
function setImagePreviews(avalue) {
    //获取选择图片的对象
    var docObj = document.getElementById("doc");
    //后期显示图片区域的对象
    var dd = document.getElementById("dd");
    dd.innerHTML = "";
    //得到所有的图片文件
    var fileList = docObj.files;
    //循环遍历
    for (var i = 0; i < fileList.length; i++) {    
        //动态添加html元素        
        dd.innerHTML += "<div style='float:left' > <img id='img" + i + "'  /> </div>";
        //获取图片imgi的对象
        var imgObjPreview = document.getElementById("img"+i); 
        
        if (docObj.files && docObj.files[i]) {
            //火狐下，直接设img属性
            imgObjPreview.style.display = 'block';
            imgObjPreview.style.width = '80px';
            imgObjPreview.style.height = '80px';
            //imgObjPreview.src = docObj.files[0].getAsDataURL();
            //火狐7以上版本不能用上面的getAsDataURL()方式获取，需要以下方式
            imgObjPreview.src = window.URL.createObjectURL(docObj.files[i]);   //获取上传图片文件的物理路径
        }
       
    }  
    return true;
}
//编辑器
 layui.use('layedit', function(){
            var layedit = layui.layedit;
            layedit.build('demo'); //建立编辑器
          });

</script>
</body>
</html>